package com.qc.wintrax.utils;

import android.app.Activity;
import android.content.Intent;

import com.qc.wintrax.WTApplication;

public class IntentUtil {

    public static void startActivity(Class<? extends Activity> toActivity) {
        Activity fromActivity = WTApplication.getInstance().getCurrentActivity();
        if (null == fromActivity) {
            return;
        }
        Intent intent = new Intent(fromActivity.getApplicationContext(), toActivity);
        fromActivity.startActivity(intent);
    }

    public static void startActivity(Class<? extends Activity> toActivity, Intent src) {
        Activity fromActivity = WTApplication.getInstance().getCurrentActivity();
        if (null == fromActivity) {
            return;
        }
        Intent intent = new Intent(fromActivity.getApplicationContext(), toActivity);
        intent.putExtras(src);
        fromActivity.startActivity(intent);
    }


}